package student.aistar.day10.obj;

public class ProductInfo {
    private Integer id;

    private String info;

    public ProductInfo() {
    }

    public ProductInfo(Integer id, String info) {
        this.id = id;
        this.info = info;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public boolean equals(Object obj){
        if(null == obj)
            return false;
        if(this == obj)
            return true;
        if(obj instanceof ProductInfo){
            ProductInfo info = (ProductInfo) obj;
            return this.id == info.id;
        }
        return false;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ProductInfo{");
        sb.append("id=").append(id);
        sb.append(", info='").append(info).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
